package com.uniview.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.uniview.base.BaseDao;
import com.uniview.entity.po.CCRelation;

@Repository
public class CCRelationDao extends BaseDao<CCRelation> {

	/**
	 * 获取用户的抄送人列表
	 * 
	 * @param owner
	 * @return
	 * @throws Exception
	 */
	public List<CCRelation> findCCByOwner(String owner) throws Exception {
		String hql = "from CCRelation c where c.owner='" + owner + "'";
		return this.findByHql(hql);
	}

	/**
	 * 删除用户的抄送人关联
	 * 
	 * @param owner
	 * @return
	 * @throws Exception
	 */
	public boolean removeCCByOwner(String owner) throws Exception {
		String hql = "delete from CCRelation where owner='" + owner + "'";
		return this.deleteByHql(hql);
	}
}
